#include "HandleR3.h"
#include "../MyDriver5/Public.h"

CHandle::CHandle()
{
	this->Init();
}

CHandle::~CHandle()
{
}

bool CHandle::ProtectedProcess(DWORD64 pid)
{
	char buf[0xe0] = { 0 };
	stCommonDate* date = (stCommonDate*)buf;

	date->id = 0x123456;
	date->cmd = PROTECTEDPROCESS;
	date->pid = (ULONG64)pid;
	date->srcAddr = 0;
	date->dstAddr = 0;
	date->size = 0;
	date->reStatus = -1;

	this->SendBuf(date, 0xe0);

	return date->reStatus == 0;

}

bool CHandle::RegObCallToProtected(DWORD64 pProtectProcessName)
{
	char buf[0xe0] = { 0 };
	stCommonDate* date = (stCommonDate*)buf;

	date->id = 0x123456;
	date->cmd = OBREGPORTECTED;
	date->pid = 0;
	date->srcAddr = pProtectProcessName;
	date->dstAddr = 0;
	date->size = 0;
	date->reStatus = -1;

	this->SendBuf(date, 0xe0);

	return date->reStatus == 0;
}

bool CHandle::EnumCallBack()
{
	char buf[0xe0] = { 0 };
	stCommonDate* date = (stCommonDate*)buf;

	date->id = 0x123456;
	date->cmd = ENUMCALLBACK;
	date->pid = 0;
	date->srcAddr = 0;
	date->dstAddr = 0;
	date->size = 0;
	date->reStatus = -1;

	this->SendBuf(date, 0xe0);

	return date->reStatus == 0;

	
}

bool CHandle::DelteCallBack(DWORD64 address, DWORD64 type)
{
	char buf[0xe0] = { 0 };
	stCommonDate* date = (stCommonDate*)buf;

	date->id = 0x123456;
	date->cmd = UNSETORREGCALLBACK;
	date->pid = 0;
	date->srcAddr = address;
	date->dstAddr = type;
	date->size = 0;
	date->reStatus = -1;

	this->SendBuf(date, 0xe0);

	return date->reStatus == 0;
}

void CHandle::SendDate(PVOID buf, DWORD bufLen)
{
}
